package com.donald.videoHub.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.Objects;



/**
 * @TableName video
 */
@TableName(value ="video")
public class Video implements Serializable {
    private static final long serialVersionUID = 1L;
    private static final Log log = LogFactory.getLog(Video.class);

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String title;

    private String path;

    private Long duration;
    // 大小 G
    private String size;
    // 大小 B
    private Long sizeB;

    private String director;

    private Integer actorId;

    private String actorName;

    private Date createTime;

    private Date checkTime;

    private Date publishTime;

    private String genre;

    private Short inlegal;

    private Short rate;
    @TableField(exist=false)
    private String[] multiGenre;
    @TableField(exist=false)
    private String[] multiActor;
    @TableField(exist=false)
    private Integer pageSize;
    @TableField(exist=false)
    private Integer currentPage;
    @TableField(exist=false)
    private String prop;
    @TableField(exist=false)
    private String order;
    // 硬盘盘符
    @TableField(exist=false)
    private String disk;
    // 播放器路径
    @TableField(exist=false)
    private String playerPath;


    public Long getDuration() {
        return duration;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public Long getSizeB() {
        return sizeB;
    }

    public void setSizeB(Long sizeB) {
        this.sizeB = sizeB;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public Integer getActorId() {
        return actorId;
    }

    public void setActorId(Integer actorId) {
        this.actorId = actorId;
    }

    public String getActorName() {
        return actorName;
    }

    public void setActorName(String actorName) {
        this.actorName = actorName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public String getGenre() {
        return genre;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public Short getInlegal() {
        return inlegal;
    }

    public void setInlegal(Short inlegal) {
        this.inlegal = inlegal;
    }

    public Short getRate() {
        return rate;
    }

    public void setRate(Short rate) {
        this.rate = rate;
    }

    public String[] getMultiGenre() {
        return multiGenre;
    }

    public void setMultiGenre(String[] multiGenre) {
        this.multiGenre = multiGenre;
    }

    public String[] getMultiActor() {
        return multiActor;
    }

    public void setMultiActor(String[] multiActor) {
        this.multiActor = multiActor;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public String getProp() {
        return prop;
    }

    public void setProp(String prop) {
        this.prop = prop;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getDisk() {
        return disk;
    }

    public void setDisk(String disk) {
        this.disk = disk;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Video)) return false;
        Video video = (Video) o;
        return getSizeB().equals(video.getSizeB());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getSizeB());
    }

    @Override
    public String toString() {
        return "Video{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", path='" + path + '\'' +
                ", duration=" + duration +
                ", size='" + size + '\'' +
                ", sizeB=" + sizeB +
                ", director='" + director + '\'' +
                ", actorId=" + actorId +
                ", actorName='" + actorName + '\'' +
                ", createTime=" + createTime +
                ", checkTime=" + checkTime +
                ", publishTime=" + publishTime +
                ", genre='" + genre + '\'' +
                ", inlegal=" + inlegal +
                ", rate=" + rate +
                ", multiGenre=" + Arrays.toString(multiGenre) +
                ", multiActor=" + Arrays.toString(multiActor) +
                ", pageSize=" + pageSize +
                ", currentPage=" + currentPage +
                ", prop='" + prop + '\'' +
                ", order='" + order + '\'' +
                ", disk='" + disk + '\'' +
                '}';
    }
}